package cn.charmaine.basic.util;

import lombok.Data;

@Data
public class AjaxResult {
   /* private Boolean success = true;
    private String msg = "操作成功";
    public AjaxResult(){}
    public AjaxResult(Boolean success,String msg){
        this.success = success;
        this.msg = msg;
    }*/

    private Boolean success = true;
    private String msg = "操作成功！";

    private Object resultObj;//路径

    //成功，直接返回对象
    public static AjaxResult thisSuccess(){
        return new AjaxResult();
    }

    //失败
    //设置成功状态
    public AjaxResult setSuccess(Boolean success){
        this.success=success;
        return this;
    }
    //设置返回信息
    public AjaxResult setMessage(String message){
        this.msg=message;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
